#include <cmath> // for fabs, modf, copysign, round, fmax
#include <cstdint> // for uint32_t, int32_t, uint16_t, int16_t, uint8_t, INT32_MAX
#include <cstdio> // for printf, SEEK_SET, snprintf, SEEK_CUR
-#include <cstdlib> // for labs
+#include <cstdlib> // for abs
#include <cstring> // for memcmp, strlen
#include <type_traits> // for add_const<>::type
if (exif_wpt_ref == nullptr) {
exif_wpt_ref = wpt;
- } else if (labs(exif_time_ref.msecsTo(wpt->creation_time)) < labs(exif_time_ref.msecsTo(exif_wpt_ref->creation_time))) {
+ } else if (std::abs(exif_time_ref.msecsTo(wpt->creation_time)) < std::abs(exif_time_ref.msecsTo(exif_wpt_ref->creation_time))) {
exif_wpt_ref = wpt;
}
}
if (exif_wpt_ref == nullptr) {
warning(MYNAME ": No point with a valid timestamp found.\n");
- } else if (labs(exif_time_ref.secsTo(exif_wpt_ref->creation_time)) > frame) {
+ } else if (std::abs(exif_time_ref.secsTo(exif_wpt_ref->creation_time)) > frame) {
QString time_str = exif_time_str(exif_time_ref);
warning(MYNAME ": No matching point found for image date %s!\n", qPrintable(time_str));
if (exif_wpt_ref != nullptr) {
QString str = exif_time_str(exif_wpt_ref->creation_time);
- warning(MYNAME ": Best is from %s, %ld second(s) away.\n",
- qPrintable(str), labs(exif_time_ref.secsTo(exif_wpt_ref->creation_time)));
+ warning(MYNAME ": Best is from %s, %lld second(s) away.\n",
+ qPrintable(str), std::abs(exif_time_ref.secsTo(exif_wpt_ref->creation_time)));
}
exif_wpt_ref = nullptr;
}
} catch (ReaderException& e) {
if (opt_recoverymode) {
warning(MYNAME ": %s\n",e.what());
- warning(MYNAME ": Aborting read and continuning processing.\n");
+ warning(MYNAME ": Aborting read and continuing processing.\n");
} else {
fatal(MYNAME ": %s Use recoverymode option at your risk.\n",e.what());
}
rdata->crdate = gbfgetint32(fin);
if (GPI_DBG) {
time_t crdate = GPS_Math_Gtime_To_Utime(rdata->crdate);
- warning("crdate = %lu (%s)\n", rdata->crdate,
+ warning("crdate = %lld (%s)\n", (long long) rdata->crdate,
CSTR(QDateTime::fromSecsSinceEpoch(crdate, Qt::UTC).toString(Qt::ISODate)));
}
/* internal procedures */
static constexpr char GPSBABEL_INIFILE[] = "gpsbabel.ini";
+#ifndef __WIN32__
static constexpr char GPSBABEL_SUBDIR[] = ".gpsbabel";
+#endif
static QString
WriteFile(usb_handle, obuf, sz, &rsz, NULL);
if (rsz != sz) {
- fatal("Error sending %d bytes. Successfully sent %ld\n", sz, rsz);
+ fatal("Error sending %zu bytes. Successfully sent %ld\n", sz, rsz);
}
return rsz;
buf_rewind(h);
- db(2, "Checking %lu bytes of data against format %d\n", h->used, fmt);
+ db(2, "Checking %zu bytes of data against format %d\n", h->used, fmt);
for (;;) {
size_t got = buf_read(h, buf, reclen);
buf_rewind(&pst->data);
- db(2, "Processing %lu bytes of data using format %d\n", pst->data.used, fmt);
+ db(2, "Processing %zu bytes of data using format %d\n", pst->data.used, fmt);
for (;;) {
size_t got = buf_read(&pst->data, buf, reclen);
{
char buf[RECLEN_WBT201];
- db(2, "Processing %lu bytes of data\n", st->data.used);
+ db(2, "Processing %zu bytes of data\n", st->data.used);
while (buf_read(&st->data, buf, sizeof(buf)) == sizeof(buf)
&& wbt201_data_chunk(st, buf)) {